

//View notepad for structure

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.SwingUtilities;


public class Gallery extends JFrame implements WindowListener{

	public static void main(String[] args){
		//Check online server status
		//Initialize GUI
		Gallery myGal = new Gallery();
		myGal.setVisible(true);

	}

	public Gallery() {
		//construct it
		this.setTitle("Picture Gallery");
		this.setSize(1200, 700);
		this.setExtendedState(this.getExtendedState() | JFrame.MAXIMIZED_BOTH); 
		addWindowListener(this);
		createMenu();
		
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
	}
	private void createMenu() {
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		JMenu fileMenu = new JMenu("File");
		JMenu editMenu = new JMenu("Edit");
		JMenu viewMenu = new JMenu("View");
		menuBar.add(fileMenu);
		menuBar.add(editMenu);
		menuBar.add(viewMenu);
		JMenuItem newAction =   new JMenuItem("New");
		JMenuItem openAction =  new JMenuItem("Open");
		JMenuItem exitAction =  new JMenuItem("Exit");
		JMenuItem cutAction =   new JMenuItem("Cut");
		JMenuItem copyAction =  new  JMenuItem("Copy");
		JMenuItem pasteAction =  new JMenuItem("Paste");
		JMenuItem toolbarsAction= new JMenuItem("toolbarsAction");
		fileMenu.add(newAction);
		fileMenu.add(openAction);
		fileMenu.addSeparator();
		fileMenu.add(exitAction);
		editMenu.add(cutAction);
		editMenu.add(copyAction);
		editMenu.add(pasteAction);
		viewMenu.add(toolbarsAction);

		newAction.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent event) {
				System.exit(0);
			}

		});		
	}

	private void importPicture() {

	}

	private void importHiddenPicture() {

		//note we need to figure out how to save them into some "data" file

	}

	private void validateLogin() {

	}

	@Override
	public void windowActivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowClosed(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowClosing(WindowEvent arg0) {
		// TODO Auto-generated method stub
		System.out.println("Hello");
		try {
			Thread.sleep(322);
		} catch (Exception e) {}
	}

	@Override
	public void windowDeactivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowDeiconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowIconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowOpened(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
}
